import syntaxtree.*;
import dk.ange.octave.OctaveEngine;
import dk.ange.octave.OctaveEngineFactory;
import visitor.*;
import logic.*;

public class Main {
   public static void main(String [] args) {
      try {
		 OctaveEngineer.getOctaveEngine(); 
         Node root = new QuantumCompiler(System.in).program();
         //System.out.println("Program parsed successfully");
         //root.accept(new ForConstructingVisitor());
         root.accept(new GJNoArguDepthFirst());
         CircuitFactory factory=CircuitFactory.getInstance();
         factory.decompose1();
         factory.output();
         OctaveEngineer.endOctaveEngine();
      }
      catch (ParseException e) {
         System.out.println(e.toString());
      }
   }
}
